<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">
<body>
	<ui:composition>
		<script>
			function handleClose(xhr, status, args) {
				if (!args.validationFailed) {
					PF('projectItemDialog').hide();
				}
			}
		</script>
		<p:dialog header="Project Detail" widgetVar="projectItemDialog"
			modal="true" showEffect="fade" hideEffect="fade" resizable="false">

			<h:form id="formDlg">
				<p:outputPanel id="projectItemDetail" style="text-align:center;">
					<p:panelGrid columns="3"
						rendered="#{not empty dtProjectLazyView.selectedItem}"
						columnClasses="label,value">

						<h:outputText value="Project ID" />
						<h:inputText disabled="true" readonly="true"
							value="#{dtProjectLazyView.projectId}" />
						<h:message for="uname" style="color:red" />

						<h:outputText value="Project Code" />
						<p:inputText id="pname" value="#{dtProjectLazyView.code}"
							maxlength="15" required="true"
							requiredMessage="Project code is mandatory!" />
						<h:message for="pname" style="color:red" />

						<h:outputText value="Project Descriptoin" />
						<p:inputText id="pdesc" value="#{dtProjectLazyView.description}"
							maxlength="255" required="true"
							requiredMessage="Description is mandatory!" />
						<h:message for="pdesc" style="color:red" />


						<h:outputText value="Default Warehouse" />
						<p:selectOneMenu id="warehouse" style="text-align:right;"
							value="#{dtProjectLazyView.warehouse}">
							<f:selectItem itemLabel="Select Warehouse" itemValue="" />
							<f:selectItems var="warehouse"
								value="#{dtProjectLazyView.warehouses}"
								itemLabel="#{warehouse.name}" itemValue="#{warehouse.id}" />
						</p:selectOneMenu>
						<h:message for="warehouse" style="color:red" />

					</p:panelGrid>

					<br />
					<p:commandButton value="Update Project"
						action="#{dtProjectLazyView.updateProject}"
						update=":form:projectItemTable @form"
						oncomplete="if (args &amp;&amp; !args.validationFailed) PF('projectItemDialog').hide()" />

				</p:outputPanel>
			</h:form>
		</p:dialog>
	</ui:composition>
</body>
</html>